package casa.depesos.app.com.http.req;


import java.util.Map;

import casa.depesos.app.com.http.HttpReq;
import casa.depesos.app.com.http.ReqCallback;
import casa.depesos.app.com.http.bean.GetCodeBean;
import casa.depesos.app.com.http.parser.GetCodeParser;
import casa.depesos.app.com.utils.Utils;

public class ChangePwdReq implements HttpReq<GetCodeBean> {
    String old, now;

    public ChangePwdReq(String old, String now) {
        this.old = old;
        this.now = now;
    }

    @Override
    public void req(ReqCallback<GetCodeBean> callback) {//  /app/user/upPassword
        req("/app/consumer/modifySecurityCredentials", new GetCodeParser(), callback);
    }

    @Override
    public Map getBody() {
        Map map = HttpReq.super.getBody();
        map.put("mobile", Utils.getPhone());
        map.put("mobPre", "51");
        map.put("oldPass", old);
        map.put("authentication", now);
        map.put("passwordVerification", now);

        return map;
    }
}
